jQuery.fn.bubble = function(option){

 var option=jQuery.extend({
	 left: '100', // цвет шрифта четных строк
	 top: '100', // цвет шрифта нечетных строк
	 trigger:'a',
	 messege:''
	 
 	},option);
 	return this.each(function() 
 			{
 				
 				$(this).append(	'<table style="margin:0px;padding:0px;opacity: 0; top: '+option.top+'px; left: '+option.left+'px;" id="dpop" class="popup">' +
								'<tbody><tr>' +
								'<td id="topleft" class="corner" style="margin:0px;padding:0px;"></td>' +
								'<td class="top" style="margin:0px;padding:0px;"></td>' +
								'<td id="topright" class="corner" style="margin:0px;padding:0px;"></td>' +
								'</tr><tr style="margin:0px;padding:0px;">' +
								'<td class="left" style="margin:0px;padding:0px;"></td>' +
								'<td style="margin:0px;padding:0px;background:#fff;">'+option.messege+'</td>' +
								'<td class="right" style="margin:0px;padding:0px;"></td>' +
								'</tr><tr style="margin:0px;padding:0px;">' +
								' <td class="corner" id="bottomleft" style="margin:0px;padding:0px;"></td>' +
								'<td class="bottom" style="margin:0px;padding:0px;"><img alt="popup tail" src="../css/images/bubble-tail2.png" height="29" width="30" /></td>' +
								'<td id="bottomright" class="corner" style="margin:0px;padding:0px;"></td>' +
								' </tr></tbody></table>' +
								'</div>');

 				var temp=this;
 		        var distance = 10;
				var time = 100;
				var hideDelay = 200;
				var hideDelayTimer = null;
				var beingShown = false;
				var shown = false;
				var info = $('.popup', this).css('opacity', 0);
				$(info).css("display",'none').css("position","absolute");
 				$('.'+option.trigger).mouseover(function () 
 					{
						if(hideDelayTimer)clearTimeout(hideDelayTimer);
						if(beingShown||shown)
							{
								return;
							}
							else
							{
								beingShown=true;
								info.css({
									top:option.top-$(info).height()-30,
									left:option.left-$(info).width()/2+10,
									display:'block'
									
									})
									.css('z-index',1001)
									.animate(
									{
										top:(option.top-$(info).height()-distance+10)+'px',
										opacity:1
									},time,'swing',function()
										{
											beingShown=false;
											shown=true;
									});
							}
							return false;
							})
							.mouseout(function()
							{
								if(hideDelayTimer)clearTimeout(hideDelayTimer);
								info.css('z-index',1000);
								hideDelayTimer=setTimeout(function()
								{
								hideDelayTimer=null;
								info.animate(
								{
									top:(option.top-$(info).height()-30)+'px',
									opacity:0
								},time,'swing',function()
									{
										shown=false;
										info.css('display','none');
									});
								},hideDelay);
								return false;
							});
			});
};